Last updated: 2019-01-04

workflowr checks: (Click a bullet for more information)
  • R Markdown file: uncommitted changes The R Markdown is untracked by Git. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run wflow_publish to commit the R Markdown file and build the HTML.

  • Environment: objects present

    The global environment had objects present when the code in the R Markdown file was run. These objects can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment. Use wflow_publish or wflow_build to ensure that the code is always run in an empty environment.

    The following objects were defined in the global environment when these results were created:

    Name Class Size
    alignMerge cwlStepParam 301.6 Kb
    fq1 list 832 bytes
    fq2 list 832 bytes
    inputList list 3.5 Kb
    mc3 cwlStepParam 90.6 Kb
    paramList list 576 bytes
    rgs list 880 bytes
    samples list 592 bytes
  • Seed: set.seed(20181205)

    The command set.seed(20181205) was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.

  • Session information: recorded

    Great job! Recording the operating system, R version, and package versions is critical for reproducibility.

  • Repository version: e8464d6

    Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. The version displayed above was the version of the Git repository at the time these results were generated.

    Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use wflow_publish or wflow_git_commit). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated:
    
    Untracked files:
        Untracked:  analysis/Rcwl_DNASeq_Align.Rmd
        Untracked:  analysis/Rcwl_DNASeq_Align.Rmd~
        Untracked:  analysis/Rcwl_GATK4.Rmd
        Untracked:  analysis/Rcwl_GATK4.Rmd~
        Untracked:  analysis/Rcwl_MC3.Rmd
        Untracked:  analysis/Rcwl_MC3.Rmd~
        Untracked:  bwaOutput.sam
        Untracked:  code/gatk.R
        Untracked:  code/gatk.R~
        Untracked:  data/fq1_1.fq
        Untracked:  data/fq1_2.fq
        Untracked:  data/fq2_1.fq
        Untracked:  data/fq2_2.fq
        Untracked:  data/normal.bam
        Untracked:  data/normal.bam.bai
        Untracked:  data/normal_1.fq
        Untracked:  data/normal_2.fq
        Untracked:  data/tumor.bam
        Untracked:  data/tumor.bam.bai
        Untracked:  data/tumor_1.fq
        Untracked:  data/tumor_2.fq
        Untracked:  file571cd084c44/
        Untracked:  output/BAM/
        Untracked:  output/GATK/
        Untracked:  output/interval.21.interval_list
        Untracked:  output/interval.21.intervals
        Untracked:  output/interval.list~
        Untracked:  output/interval.txt
        Untracked:  output/mc3/
        Untracked:  sample1.bam
        Untracked:  sample1.bam.bai
        Untracked:  tmpl1.json
    
    
    Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes.

Introduction

The Multi-Center Mutation Calling in Multiple Cancers project (MC3) pipeline was developed by TCGA to generate a comprehensive encyclopedia of somatic mutation calls by applying an ensemble of seven mutation-calling algorithms with scoring and artifact filtering. More details can be found in this paper: Scalable Open Science Approach for Mutation Calling of Tumor Exomes Using Multiple Genomic Pipelines

The mc3 pipeline is available at https://github.com/OpenGenomics/mc3. All required software have been deployed in cloud with docker.

The pipeline has been imported and contained in the RcwlPipelines pacakge, which contains two major steps (markID step was removed):

  • Call variants by 7 pipelines
  • Merge VCF and convert to MAF

Here is the short summary.

suppressPackageStartupMessages(library(Rcwl))
library(RcwlPipelines)

data(mc3)
short(mc3)
inputs:
- tumorID
- normalID
- tumor
- normal
- bed_file
- centromere
- cosmic
- dbsnp
- refFasta
- vepData
outputs:
- outmaf
- outvcf
steps:
- call_variants
- convert
plotCWL(mc3)
  1. call_variants
callVar <- readCWL(runs(mc3)$call_variants)
plotCWL(callVar)
  1. Convert
conv <- readCWL(runs(mc3)$convert)
plotCWL(conv)

Prepare data

Testing somatic mutation data can be download from: https://github.com/genome/somatic-snv-test-data.

  1. Input list inputList. The tumorID/normalID must be consistent with SM from BAM read group.
inputList <- list(tumorID=list(test="NA12892"),
                  normalID=list(test="NA12878"),
                  tumor=list(test="data/tumor.bam"),
                  normal=list(test="data/normal.bam"))
  1. Parameter list paramList.
paramList <- list(bed_file="/mnt/lustre/users/qhu/software/mc3/data/gaf_20111020+broad_wex_1.1_hg19.bed",
                  centromere="/mnt/lustre/users/qhu/software/mc3/data/centromere_hg19.bed",
                  cosmic="/mnt/lustre/users/qhu/software/mc3/data/hg19_cosmic_v54_120711.vcf.gz",
                  dbsnp="/mnt/lustre/users/qhu/software/mc3/data/dbsnp_134_b37.leftAligned.vcf.gz",
                  refFasta="/rpcc/bioinformatics/reference/current/human_g1k_v37.fa.gz",
                  vepData="/home/qhu/.vep/")

Run MC3 pipeline

res <- runCWLBatch(mc3, wdir = "output/mc3",
                   inputList = inputList, paramList = paramList,
                   BPPARAM = BatchtoolsParam(workers = 1, cluster = "sge",
                                             template = "/rpcc/bioinformatics/sge_centos7.tmpl",
                                             resources = list(threads = 2,
                                                              queue = "centos7.q")))

The final VCF was filtered and merged from the outputs of different pipelines and annotated by VEP. The converted MAF file was also generated.

dir("output/mc3/test")
[1] "merged.vep.vcf" "vep.maf"       
vcf <- read.table("output/mc3/test/merged.vep.vcf", sep="\t")
head(vcf)
  V1       V2          V3 V4 V5  V6   V7
1 21 10400299           .  A  T 0.0 PASS
2 21 10400380           .  C  T   . PASS
3 21 10402435   rs2948877  G  A   . PASS
4 21 10402715           .  G  A 0.0 PASS
5 21 10402795 rs148043841  G  T   . PASS
6 21 10402985           .  G GA   . PASS
                                                                                                                                                                                               V8
1                                               CENTERS=RADIA|VARSCANS|MUSE|SOMATICSNIPER;CSQ=T|intergenic_variant|MODIFIER|||||||||||||||rs370695467|1||||1|SNV|1|||||||||||||||||||||||||||||||
2                                                          CENTERS=SOMATICSNIPER|RADIA|VARSCANS|MUSE;CSQ=T|intergenic_variant|MODIFIER||||||||||||||||1||||1|SNV|1|||||||||||||||||||||||||||||||
3 CENTERS=MUSE|RADIA|VARSCANS|SOMATICSNIPER;CSQ=A|intergenic_variant|MODIFIER|||||||||||||||rs2948877|1||||1|SNV|1||||||||||||||||A:0.3626|A:0.4266|A:0.3228|A:0.3075|A:0.2913|A:0.4346||||||||||
4                                                               CENTERS=RADIA|VARSCANS|MUSE;CSQ=A|intergenic_variant|MODIFIER|||||||||||||||rs2948878|1||||1|SNV|1|||||||||||||||||||||||||||||||
5                                                             CENTERS=MUSE|RADIA|VARSCANS;CSQ=T|intergenic_variant|MODIFIER|||||||||||||||rs373568457|1||||1|SNV|1|||||||||||||||||||||||||||||||
6                                                          CENTERS=VARSCANI*|PINDEL;CSQ=A|intergenic_variant|MODIFIER|||||||||||||||rs375209288|1||||1|insertion|1|||||||||||||||||||||||||||||||
        V9           V10            V11
1 GT:DP:AD 0/0:140:140,0   0/1:92:71,20
2 GT:DP:AD 0/0:160:160,0  0/1:117:99,18
3 GT:DP:AD 0/0:167:167,0  0/1:124:97,27
4 GT:DP:AD 0/0:145:145,0  0/1:117:97,20
5 GT:DP:AD 0/0:163:161,2 0/1:127:108,19
6 GT:DP:AD   0/0:88:88,0    0/1:82:75,7

Session information

sessionInfo()
R version 3.5.2 Patched (2018-12-31 r75935)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.4 (Final)

Matrix products: default
BLAS: /home/qhu/usr/R-3.5/lib64/R/lib/libRblas.so
LAPACK: /home/qhu/usr/R-3.5/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
[1] RcwlPipelines_0.0.0.9000 jsonlite_1.6            
[3] BiocParallel_1.16.2      Rcwl_0.99.7             
[5] S4Vectors_0.20.1         BiocGenerics_0.28.0     
[7] yaml_2.2.0               workflowr_1.1.1         

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.0         tidyr_0.8.2        visNetwork_2.0.5  
 [4] prettyunits_1.0.2  assertthat_0.2.0   rprojroot_1.3-2   
 [7] digest_0.6.18      plyr_1.8.4         R6_2.3.0          
[10] backports_1.1.3    evaluate_0.12      highr_0.7         
[13] ggplot2_3.1.0      pillar_1.3.1       rlang_0.3.0.1     
[16] progress_1.2.0     lazyeval_0.2.1     rstudioapi_0.8    
[19] data.table_1.11.8  whisker_0.3-2      R.utils_2.7.0     
[22] R.oo_1.22.0        checkmate_1.8.5    rmarkdown_1.11    
[25] DiagrammeR_1.0.0   downloader_0.4     readr_1.3.1       
[28] stringr_1.3.1      htmlwidgets_1.3    igraph_1.2.2      
[31] munsell_0.5.0      compiler_3.5.2     influenceR_0.1.0  
[34] rgexf_0.15.3       xfun_0.4           pkgconfig_2.0.2   
[37] htmltools_0.3.6    tidyselect_0.2.5   gridExtra_2.3     
[40] tibble_1.4.2       batchtools_0.9.11  XML_3.98-1.16     
[43] viridisLite_0.3.0  crayon_1.3.4       dplyr_0.7.8       
[46] withr_2.1.2        R.methodsS3_1.7.1  rappdirs_0.3.1    
[49] grid_3.5.2         gtable_0.2.0       git2r_0.23.0      
[52] magrittr_1.5       scales_1.0.0       stringi_1.2.4     
[55] debugme_1.1.0      viridis_0.5.1      bindrcpp_0.2.2    
[58] brew_1.0-6         RColorBrewer_1.1-2 tools_3.5.2       
[61] glue_1.3.0         purrr_0.2.5        hms_0.4.2         
[64] Rook_1.1-1         colorspace_1.3-2   base64url_1.4     
[67] knitr_1.21         bindr_0.1.1       

This reproducible R Markdown analysis was created with workflowr 1.1.1